﻿
<!-- THIS VIEW IS NOT IN USE ANYMORE -->

@*@{
    ViewBag.Title = "Ask a Question";
}

@section scripts{
    @Scripts.Render("~/bundles/AskQuestionJsBundle")    
}

<h2>Ask a Question</h2> 
<div class="row" ng-controller="AskQuestionController" ng-init="init()">
    <div class="col-md-9">
        <div ng-show="saveError" class="alert alert-danger">Oops! Something went wrong. Try again later</div>
        <div ng-show="saveSuccessfull" class="alert alert-success">Question added. Redirecting...</div>
        <form role="form" class="question-form" novalidate="" name="qform">
            <div class="form-group posrel">
                <label for="question-title">What Question would you like to ask?</label>
                <input name="title"
                       ng-model="questionModel.Title"
                       required=""
                       ng-minlength="10"
                       ng-maxlength="100"
                       type="text"
                       class="form-control" id="question-title" placeholder="Type your question here" autofocus="autofocus" />
                <p ng-show="qform.title.$error.required" class="form-msg err posabs">Required.</p>
                <p ng-show="qform.title.$error.minlength" class="form-msg err posabs">Title should be minimum 10 characters.</p>
                <p ng-show="qform.title.$error.maxlength" class="form-msg err posabs">Title too long.</p>
                <p class="form-msg info posabs" ng-show="questionModel.Title.length > 0 && questionModel.Title.length >= 10 && questionModel.Title.length <= 100">{{ 100 - questionModel.Title.length }} characters remaining</p>
            </div>
            <div class="form-group posrel">
                <label for="question-description">Describe the Question you are asking.</label>
                <textarea ng-model="questionModel.Body" class="form-control textarea" id="question-decription" placeholder="Keep it simple and easy to understand."></textarea>
                <span class="form-msg err posabs" ng-hide="questionModel.Body">Required</span>
            </div> 
            <!-- What topics/category best describe the Question you are asking... ?--->
            <button ng-disabled="saveSuccessfull" type="submit" class="btn-success btn btn-default" ng-click="saveQuestion()">Submit</button>
        </form>
    </div>
    
    @Html.Partial("~/Views/Shared/Sidebar.cshtml")
</div>*@